import { createRouter, createWebHistory } from 'vue-router'
import Layout from '../views/Layout.vue'
import Home from '../views/Home-Screen/index.vue'
import Login from '../views/Login.vue'

const routes = [
  {
    // path:'/login',
    // redirect: Login
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('../views/Login.vue')
  },
  {
    path: '/',
    name: 'layout',
    component: Layout,
    meta:{
      title:'主界面'
    },
    children: [
      {
        path: 'homeScreen',
        name: 'homeScreen',
        component: () => import('../views/Home-Screen/index.vue'),
        meta:{
          title:'首页'
        }
      },
      {
        path: 'userList',
        name: 'userList',
        component: () => import('../views/User-Management/index.vue'),
        meta:{
          title:'用户列表'
        }
      },
      {
        path: 'productList',
        name: 'productList',
        component: () => import('../views/productList/index.vue'),
        meta:{
          title:'商品列表'
        }
      },
      {
        path: 'categoryList',
        name: 'categoryList',
        component: () => import('../views/categoryList/index.vue'),
        meta:{
          title:'商品列表'
        }
      },
      {
        path: 'orderList',
        name: 'orderList',
        component: () => import('../views/orderList/index.vue'),
        meta:{
          title:'订单列表'
        }
      },
      {
        path: 'opinionList',
        name: 'opinionList',
        component: () => import('../views/opinionList/index.vue'),
        meta:{
          title:'评价与反馈列表'
        }
      },
      {
        path: 'countList',
        name: 'countList',
        component: () => import('../views/countList/index.vue'),
        meta:{
          title:'统计列表'
        }
      },
      {
        path: 'eventInfoList',
        name: 'eventInfoList',
        component: () => import('../views/event/index.vue'),
        meta:{
          title:'活动列表'
        }
      },
      {
        path: 'rotateList',
        name: 'rotateList',
        component: () => import('../views/rotateList/index.vue'),
        meta:{
          title:'首页轮播列表'
        }
      },

      {
        path: 'bulletinList',
        name: 'bulletinList',
        component: () => import('../views/bulletinList/index.vue'),
        meta:{
          title:'首页公告列表'
        }
      },
      {
        path: 'messageList',
        name: 'messageList',
        component: () => import('../views/Message-Management/index.vue'),
        meta:{
          title:'留言列表'
        }
      }
    ],    
  },

]

const router = createRouter({
  history: createWebHistory(),
  routes: routes
})

export default router